package edu.mtu.citizenscience.mushroommapper.model;

import com.openswimsoftware.orm.model.Model;
import com.openswimsoftware.orm.model.annotation.Child;

import android.content.Context;
import edu.mtu.citizenscience.mushroommapper.model.fieldguide.ModelGuideImage;

/**
 * @author Corbin Uselton <corbinu@cwuselto@mtu.edu>
 * @copyright (c) 2012 MichiganTech <http://www.mtu.edu>
 * @since 1.0
 * 
 * Model of a guide mushroom in the app DB has a scientific 
 * name, common name, description and image
 */
public class ModelGuideMushroom extends Model<ModelGuideMushroom> {
	// the guide mushroom family
	private String family;
	// the guide mushroom genus
	private String genus;
	// the guide mushroom species
	private String species;
	// the guide mushroom common name
	private String name;
	// the guide mushroom description
	private String description;
	
	// the guide mushroom child image
	@Child
	private ModelGuideImage image;
	
	/**
	 * Create the guide mushroom model
	 * 
	 * @param   context - Context - context for model operations
	 * @return	void
	 */
	public ModelGuideMushroom(Context context) 
	{
		super(context, ModelGuideMushroom.class);
	}

	/**
	 * Create the guide mushroom model
	 * 
	 * @param   context - Context - context for model operations
	 * @param	id - long - the id of the model to load
	 * @return	void
	 */
	public ModelGuideMushroom(Context context, long id) 
	{
		super(context, ModelGuideMushroom.class, id);
	}

	/**
	 * Get the guide mushroom family
	 * 
	 * @param   void
	 * @return	String - the family name
	 */
	public String getFamily() 
	{
		// make sure the model is loaded
		this.load();
		
		return family;
	}

	/**
	 * Set the guide mushroom family
	 * 
	 * @param   family - String - the family name
	 * @return	void
	 */
	public void setFamily(String family) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.family = family;
	}

	/**
	 * Get the guide mushroom genus
	 * 
	 * @param 	void
	 * @return	String - the genus name
	 */
	public String getGenus() 
	{
		// make sure the model is loaded
		this.load();
		
		return genus;
	}

	/**
	 * Set the guide mushroom genus
	 * 
	 * @param 	genus - String - the genus name
	 * @return	void
	 */
	public void setGenus(String genus) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.genus = genus;
	}

	/**
	 * Get the guide mushroom species
	 * 
	 * @param 	void
	 * @return	String - the species name
	 */
	public String getSpecies() 
	{
		// make sure the model is loaded
		this.load();
		
		return species;
	}

	/**
	 * Set the guide mushroom species
	 * 
	 * @param 	species - String - the species name
	 * @return	void
	 */
	public void setSpecies(String species) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.species = species;
	}

	/**
	 * Get the guide mushroom common name
	 * 
	 * @param 	void
	 * @return	String - the common name
	 */
	public String getName() 
	{
		// make sure the model is loaded
		this.load();
		
		return name;
	}

	/**
	 * Set the guide mushroom common name
	 * 
	 * @param 	name - String - the common name
	 * @return	void
	 */
	public void setName(String name) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.name = name;
	}

	/**
	 * Get the guide mushroom description
	 * 
	 * @param 	void
	 * @return	String - the description
	 */
	public String getDescription() 
	{
		// make sure the model is loaded
		this.load();
		
		return description;
	}

	/**
	 * Set the guide mushroom description
	 * 
	 * @param 	description - String - the description
	 * @return	void
	 */
	public void setDescription(String description) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.description = description;
	}

	/**
	 * Get the guide mushroom image
	 * 
	 * @param 	void
	 * @return	ModelGuideImage - the mushroom image model
	 */
	public ModelGuideImage getImage() 
	{
		// make sure the model is loaded
		this.load();
		
		return image;
	}

	/**
	 * Set the guide mushroom image
	 * 
	 * @param 	image - ModelGuideImage - the mushroom image model
	 * @return	void
	 */
	public void setImage(ModelGuideImage image) 
	{
		// mark the model as updated
		this.updated = true;
		
		this.image = image;
	}

}
